package com.slz3.business.module.systemManagement.sysUser.steward;

import com.slz3.business.module.systemManagement.sysUser.domain.SysUser;
import com.slz3.business.module.systemManagement.sysUser.domain.SysUserCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysUserResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(SysUser.class).flatMap(sysUser ->
                SysUserResController.add(req, sysUser)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.delete(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(SysUser.class).flatMap(sysUser ->
                SysUserResController.modify(req, sysUser)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return SysUserResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return SysUserResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return SysUserResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.auditSubmit(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.audit(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.auditReject(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.usingEnable(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.usingDisable(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> register(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.register(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> login(ServerRequest req) {
        return req.bodyToMono(SysUser.class).flatMap(sysUserCondition ->
                SysUserResController.login(req, sysUserCondition)
        );
    }

    public static Mono<ServerResponse> logout(ServerRequest req) {
        return req.bodyToMono(SysUserCondition.class).flatMap(sysUserCondition ->
                SysUserResController.logout(req, sysUserCondition)
        );
    }
}
